package services;

import org.apache.commons.collections.Predicate;

import t4p.model.User;

public class LoginUserPredicate implements Predicate{

	private User usuario;
	
	public LoginUserPredicate(String usr, String pss){
		this.usuario = new User();
		this.usuario.setUsername(usr);
		this.usuario.setPassword(pss);
	}
	
		public boolean evaluate(Object a) {
			boolean _return = false;
			
			User myUser = (User) a;
			if(myUser.getUsername().equals(this.usuario.getUsername())
					&& myUser.getPassword().equals(this.usuario.getPassword()))
				_return = true;
			return _return;
		}
	}
